package cn.itcast.n3_Java线程;

import lombok.extern.slf4j.Slf4j;

/**
 * <p>
 * Test03_线程运行原理_查看栈帧和方法调用的关系
 * </p>
 *
 * @author flyduck
 * @since 2024-08-21
 */
@Slf4j(topic = "c.Test03_线程运行原理2_查看多线程下栈内存和栈帧的关系")
public class Test03_线程运行原理2_查看多线程下栈内存和栈帧的关系 {
    private static Object method2() {
        Object n = new Object();
        return n;
    }

    private static void method1(int x) {
        int y = x + 1;
        Object m = method2();
        System.out.println(m);
    }

    public static void main(String[] args) {
        Thread t1 = new Thread(){
            @Override
            public void run() {
                method1(20);
            }
        };
        t1.setName("t1");
        t1.start();
        method1(10);
    }
}
